home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et-2_2.lha / et2.2 / src / VObjectTView.h < prev    next >
C/C++ Source or Header  |  1990-11-28  |  2KB  |  69 lines

  1. #ifndef VObjectTView_First
  2. #ifdef __GNUG__
  3. #pragma once
  4. #endif
  5. #define VObjectTView_First
  6.  
  7. #include "TextView.h"
  8.  
  9. //---- VObjectTextView --------------------------------------------------------
  10.  
  11. class VObjectTextView: public TextView {
  12.     VObject *kbdFocus;
  13.     void InvalidateVObjects(int from, int to);
  14. public:
  15.     MetaDef(VObjectTextView);
  16.  
  17.     VObjectTextView(class EvtHandler*, Rectangle r, class VObjectText *t,
  18.         eTextJust m= eLeft, eSpacing= eOne, bool wrap= TRUE,
  19.         TextViewFlags= (TextViewFlags)eVObjDefault, Point border= gBorder,
  20.         int id= cIdNone);    
  21.         // contentRect.width/height can be set to cFit
  22.  
  23.     //---- overriden to update VObjects 
  24.     void InvalidateRange(int from, int to);
  25.     void InvalidateRange(int from, Point fp, int to, Point tp);
  26.     void SetOrigin(Point);
  27.     void Control(int id, int part, void *val);
  28.     Text *SetText(Text *newText);
  29.  
  30.     //---- distribute input events to VObjects
  31.     Command *DispatchEvents(Point lp, Token, Clipper*);
  32.  
  33.     GrCursor GetCursor(Point);    
  34.     istream& ReadFrom(istream &s);
  35. };
  36.  
  37. //---- StretchWrapper ---------------------------------------------------------
  38. //     a VObject installed in a StretchWrapper and inserted in a 
  39. //     VObjectText can be resized interactively
  40.  
  41. class StretchWrapper: public CompositeVObject {
  42. protected:
  43.     Point interiorOffset, extentDiff, border;
  44.     VObject *interior;
  45.     bool kbdFocus;
  46. public:
  47.     MetaDef(StretchWrapper);
  48.     
  49.     StretchWrapper(VObject *inner, Point border, int= cIdNone);
  50.     VObject *GetInterior()
  51.     { return interior; }
  52.     Point GetInteriorOffset()
  53.     { return interiorOffset; }
  54.     void SetOrigin(Point at);
  55.     void SetExtent(Point e);
  56.     Metric GetMinSize();
  57.     int Base();
  58.     Command *DoLeftButtonDownCommand(Point, Token, int);
  59.     Command *DoKeyCommand(int ch, Point lp, Token t);
  60.     void Control(int id, int part, void *val);
  61.     void SendDown(int id, int part, void *val);
  62.     GrCursor GetCursor(Point);
  63.     ostream& PrintOn (ostream&s);
  64.     istream& ReadFrom(istream &);
  65.     void Draw(Rectangle);
  66. };
  67.  
  68. #endif VObjectTView_First
  69.